<template>
    <div class="public-common">
        <div class="public-title">车辆承包合同列表</div>
        <div style="padding:10px;">
            <el-row>
                <el-col :span="6">
                    <el-input placeholder="请输入内容" v-model="form.test" class="input-with-select"/>
                        
                </el-col>
                <el-col :span="18">
                    <el-button type="primary" icon="el-icon-search" style="margin-left:10px;">搜索</el-button>
                    <el-button type="success" icon="el-icon-edit-outline">新建</el-button>
                    <el-button type="danger" icon="el-icon-delete">删除</el-button>
                </el-col>
            </el-row>
        </div>

        <el-table :data="tabledata" size="mini" border stripe header-row-class-name="textcenter">
            <el-table-column
            type="selection"
            width="55" fixed="left">
            </el-table-column>
            <el-table-column
                label="车辆">
                <template slot-scope="scope">
                    {{scope.row.companyName}}
                </template>
            </el-table-column>
            <el-table-column
                label="承包人">
                <template slot-scope="scope">
                    {{scope.row.carId}}
                </template>
            </el-table-column>                
            <el-table-column
                label="合同编号">
                <template slot-scope="scope">
                    {{scope.row.carType}}
                </template>
            </el-table-column>
            <el-table-column
                label="承包年限">
                <template slot-scope="scope">
                    {{scope.row.carType}}
                </template>
            </el-table-column>
            <el-table-column
                label="承包日期">
                <template slot-scope="scope">
                    {{scope.row.carType}}
                </template>
            </el-table-column>
            <el-table-column
                label="财产安全保证金">
                <template slot-scope="scope">
                    {{scope.row.carType}}
                </template>
            </el-table-column>
            <el-table-column
                label="服务质量保证金">
                <template slot-scope="scope">
                    {{scope.row.carType}}
                </template>
            </el-table-column>
            <el-table-column
                label="残值价">
                <template slot-scope="scope">
                    {{scope.row.carType}}
                </template>
            </el-table-column>
            <el-table-column
                label="月税费标准">
                <template slot-scope="scope">
                    {{scope.row.carType}}
                </template>
            </el-table-column>
            <el-table-column
                label="操作" fixed="right">
                <template slot-scope="scope">
                    <el-button type="primary" size="mini">编辑</el-button>
                </template>
            </el-table-column> 
            
        </el-table>
        <el-pagination
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page="page.now"
        :page-sizes="page.sizes"
        :page-size="page.pagesize"
        layout="total, sizes, prev, pager, next, jumper"
        :total="page.total" style="margin-top:10px;">
        </el-pagination>
        <!--dialog-->
        <el-dialog
        width="40%"
        title="车辆承包合同"
        :visible.sync="dialog.isVisible" top="10vh">
        <el-scrollbar style="height:350px;">
            <el-form label-width="140px"  size="mini">
                <el-form-item label="车辆">
                    <el-select v-model="dialog.test" placeholder="请选择" style="width:100%">
                        <el-option
                        v-for="item in select.cars"
                        :key="item.value"
                        :label="item.label"
                        :value="item.value">
                        </el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="承包人">
                    <el-select v-model="dialog.test" placeholder="请选择" style="width:100%">
                        <el-option
                        v-for="item in select.contracts"
                        :key="item.value"
                        :label="item.label"
                        :value="item.value">
                        </el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="合同编号">
                    <el-input v-model="dialog.address"></el-input>
                </el-form-item> 
                <el-form-item label="承包年限">
                    <el-input v-model="dialog.name"></el-input>
                </el-form-item>
                <el-form-item label="承包日期">
                    <el-date-picker
                    v-model="dialog.test"
                    type="date"
                    format="yyyy-MM-dd"
                    placeholder="选择日期" style="width:100%;">
                    </el-date-picker>
                </el-form-item>
                <el-form-item label="财产安全保证金(元)">
                    <el-input v-model="dialog.address"></el-input>
                </el-form-item> 
                <el-form-item label="服务质量保证金(元)">
                    <el-input v-model="dialog.name"></el-input>
                </el-form-item>
                <el-form-item label="残值价(元)">
                    <el-input v-model="dialog.relationship"></el-input>
                </el-form-item>
                <el-form-item label="月税费标准(元)">
                    <el-input v-model="dialog.address"></el-input>
                </el-form-item>                   
            </el-form>
        </el-scrollbar>
            <div class="textcenter" style="padding-top:10px;">
                <el-button type="primary" size="mini">确定</el-button>  
                <el-button type="info" @click="dialog.isVisible = false" size="mini">返回</el-button>
            </div>
        </el-dialog>
    </div>
    
</template>
<script>
export default {
    data(){
        return {
            form:{
                test:'',
                carid:''
            },
            tabledata:[],
            page:{
              now:1,
              pagesize:10,
              sizes:[2,10, 20, 50, 100],
              total:0,
              key:''
            },
            dialog:{
                isVisible:false,
                test:''
            },
            select:{
                contracts:[],
                cars:[]
            }
        }
    },
    mounted(){
        
    },
    methods:{
        search(){
            alert("search")
        },
        //分页
        handleSizeChange(pagesize){
            this.page.pagesize = pagesize;
            this.search(true,true);
        },
        handleCurrentChange(pageno){
            this.page.now = pageno;
            this.search(true,true);
        }

    }
}
</script>
<style lang="scss">
.public-common{
    .public-title{line-height: 30px;background-color: #deecfd;}
}
</style>